package BaiDu;

import java.util.HashMap;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner cin=new Scanner(System.in);
        String line = cin.nextLine();
        HashMap<Character,int[]> map=new HashMap<>();
        map.put('L',new int[]{-1,0});
        map.put('R',new int[]{1,0});
        map.put('U',new int[]{0,1});
        map.put('D',new int[]{0,-1});
        long x=0,y=0;
        for (char c:line.toCharArray()) {
            if (map.containsKey(c)){
                x+=map.get(c)[0];
                y+=map.get(c)[1];
            }
        }
        System.out.println("("+x+","+y+")");
    }
}
